#ifndef QXGAME_GAMEMUSIC_H
#define QXGAME_GAMEMUSIC_H

#include <atomic>
#include "SDL_mixer.h"

class GameMusic {
public:
    bool CheckPlay() const
    {
        return isPlay;
    }

    void Play(Mix_Music *music)
    {
        Mix_HaltMusic();
        isPlay = true;
        Mix_PlayMusic(music, -1);
    }

    void End()
    {
        Mix_HaltMusic();
        isPlay = false;
    }

public:
    std::atomic<bool> isPlay = false;
};

#endif //QXGAME_GAMEMUSIC_H
